<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../print.css" type="text/css" media="print">
<meta content="MassInterpolator,idv.cjcat.utils.MassInterpolator,dimension,length,numSegments,clear,interpolate,push,pushVec,setData" name="keywords">
<title>idv.cjcat.utils.MassInterpolator</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'MassInterpolator - API Documentation';
				var baseRef = '../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">CJLibrary</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../index-list.html')" href="../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../index.html?idv/cjcat/utils/MassInterpolator.html&amp;idv/cjcat/utils/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;MassInterpolator</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class MassInterpolator"); titleBar_setSubNav(false,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">idv.cjcat.utils</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class MassInterpolator</td>
</tr>
</table>
<p></p>
  Linear interpolator for a series of vectors.
  <p>
  Let's say you have a series of two-dimensional vectors: (100, 0), (100, 100), (50, 100).
  The magnitude of the difference vector between the first two vectors is 100, and 50 for the last two.
  Summing up the magnitudes of all difference vectors of any consecutive two vectors in the series,
  you get the "total length" of this interpolator; in this example, the total length is 150.
  </p>
  <p>
  To interpolate, you provide an interpolation parameter <code>t</code>, which should be between zero and the total length.
  We define the "accumulated length (<code>AL</code>) of a vector <code>V</code> in the provided series" as "the sum of magnitudes of all difference vectors of all consecutive two vectors in the series from the beginning of the series up to vector <code>V</code>".
  If the interpolation parameter <code>t</code> lies between the accumulated length of vector <code>V</code>(inclusive) and <code>W</code>(exclusive),
  then we calculate the vector <code>X</code> such that <code>(V, AL[V])</code>, <code>(W, AL[W])</code>, and <code>(X, t)</code> lie on the same line,
  where X shall be our result of interpolation.
  </p>
  <p></p>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#dimension">dimension</a> : uint<div class="summaryTableDescription">
   The dimension of the interpolator.</div>
</td><td class="summaryTableOwnerCol">MassInterpolator</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#length">length</a> : Number<div class="summaryTableDescription">[read-only]
   The total length of the interpolator.</div>
</td><td class="summaryTableOwnerCol">MassInterpolator</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#numSegments">numSegments</a> : uint<div class="summaryTableDescription">[read-only]
   Number of vectors in the series minus one.</div>
</td><td class="summaryTableOwnerCol">MassInterpolator</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#MassInterpolator()">MassInterpolator</a>(dimension:uint = 2)</div>
<div class="summaryTableDescription">
   Creates an interpolator.</div>
</td><td class="summaryTableOwnerCol">MassInterpolator</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#clear()">clear</a>():Vector</div>
<div class="summaryTableDescription">
   Clears the interpolator of all vectors.</div>
</td><td class="summaryTableOwnerCol">MassInterpolator</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#interpolate()">interpolate</a>(t:Number, usePercentage:Boolean = false):Vector</div>
<div class="summaryTableDescription">
   Interpolates the vectors.</div>
</td><td class="summaryTableOwnerCol">MassInterpolator</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#push()">push</a>(... args):void</div>
<div class="summaryTableDescription">
   Adds a vector to the interpolator series.</div>
</td><td class="summaryTableOwnerCol">MassInterpolator</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#pushVec()">pushVec</a>(args:Vector):void</div>
<div class="summaryTableDescription"></div>
</td><td class="summaryTableOwnerCol">MassInterpolator</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#setData()">setData</a>(data:Vector):void</div>
<div class="summaryTableDescription"></div>
</td><td class="summaryTableOwnerCol">MassInterpolator</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="dimension"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">dimension</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>dimension:uint</code>&nbsp;&nbsp;[read-write]<p>
   The dimension of the interpolator.
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get dimension():uint</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set dimension(value:uint):void</code>
<br>
</div>
<a name="length"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">length</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>length:Number</code>&nbsp;&nbsp;[read-only]<p>
   The total length of the interpolator.
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get length():Number</code>
<br>
</div>
<a name="numSegments"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">numSegments</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>numSegments:uint</code>&nbsp;&nbsp;[read-only]<p>
   Number of vectors in the series minus one.
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get numSegments():uint</code>
<br>
</div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="MassInterpolator()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">MassInterpolator</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function MassInterpolator(dimension:uint = 2)</code><p>
   Creates an interpolator.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">dimension</span>:uint</code> (default = <code>2</code>)<code></code> &mdash;  Vector dimension.
   </td>
</tr>
</table>
</div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="clear()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">clear</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function clear():Vector</code><p>
   Clears the interpolator of all vectors.
   </p><p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Vector</code></td>
</tr>
</table>
</div>
<a name="interpolate()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">interpolate</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function interpolate(t:Number, usePercentage:Boolean = false):Vector</code><p>
   Interpolates the vectors.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">t</span>:Number</code> &mdash;  The interpolation parameter.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">usePercentage</span>:Boolean</code> (default = <code>false</code>)<code></code> &mdash;  Instead of absolute value, t is viewed as a percentage of value between zero and one.
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Vector</code></td>
</tr>
</table>
</div>
<a name="push()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">push</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function push(... args):void</code><p>
   Adds a vector to the interpolator series.
   </p><p>
   Each parameter passed is interpreted as a component of the vector, so pass a number of vectors equal to the dimension of the interpolator.
   </p>
   <span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code>... <span class="label">args</span></code></td>
</tr>
</table>
</div>
<a name="pushVec()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">pushVec</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function pushVec(args:Vector):void</code><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">args</span>:Vector</code></td>
</tr>
</table>
</div>
<a name="setData()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">setData</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function setData(data:Vector):void</code><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">data</span>:Vector</code></td>
</tr>
</table>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
